package com.company.hrmadmin.common.exception;

import com.company.hrmadmin.common.constant.ErrorEnum;

/**
 * @author Song, Wei
 * Date: 2022/4/9 17:18
 */
public class GlobalException extends RuntimeException {

    private final Integer code;

    public GlobalException(ErrorEnum errorEnum) {
        super(errorEnum.getMessage());
        this.code = errorEnum.getCode();
    }


    public GlobalException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
